﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class admin_thongkechuongtrinh : System.Web.UI.Page
{
    private int total;
    public int Total
    {
        get { return total; }
        set { total = value; }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ddl_listLoaiCT.DataSource = ChuongTrinh.GetLoaiCT();
            ddl_listLoaiCT.DataTextField = "tenloaict";
            ddl_listLoaiCT.DataValueField = "maloaict";
            ddl_listLoaiCT.Items.Add(new ListItem("--Please select--","-1"));
            ddl_listLoaiCT.AppendDataBoundItems = true;
            ddl_listLoaiCT.SelectedIndex = -1;
            ddl_listLoaiCT.DataBind();
            //load();
        } else
        {
            load();
        }
    }

    private void load()
    {
        string maloaict = ddl_listLoaiCT.SelectedItem.Value;
        var ctrinh = ChuongTrinh.XemChuongTrinh_PhanTom(Convert.ToInt32(maloaict), ref total);
        ASPxGridView1.DataSource = ctrinh;
        ASPxGridView1.DataBind();
        Label2.Text = total.ToString();
    }

   
}